package com.zhuss.product.product;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.product.product.DetailProductBo;
import com.zhuss.bean.bo.product.product.SearchProductBo;
import com.zhuss.common.ReadService;
import com.zhuss.product.processor.ProductRead;
import com.zhuss.exception.OceanException;

/**
 * @description: 商品查询Service
 * @author: zhushanshuo
 * @create: Wed Mar 24 22:26:45 CST 2021
 **/
@Component("productReadService")
public class ProductReadService implements ReadService<Object, Object> {
	
	@Autowired
	@Qualifier("productRead")
	private ProductRead productRead;
	
	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws OceanException {
		DetailProductBo bo = (DetailProductBo) param;
		Long productId = bo.getProductId();
		Object vo = productRead.detail(productId);
		return vo;
	}
	
	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) {
		SearchProductBo bo = (SearchProductBo) param;
		Object result = productRead.list(bo);
		return result;
	}
	
}

